package rm.ep.shared;

import com.googlecode.objectify.annotation.Parent;
import com.googlecode.objectify.annotation.Unindexed;

@SuppressWarnings("serial")
public class ProgressEntity extends AbstractEntity {

	@Unindexed
	private String fStaff;
	
	@Unindexed
	private String fAddressees;
	
	@Unindexed
	private String fProgress;
	
	@Unindexed
	private Long fFileEntityId;
	
	@Parent
	private com.google.appengine.api.datastore.Key fParent;
	
	protected ProgressEntity() {
		// required by GWT
	}
	
	public ProgressEntity(String staff, String addressees, String progress, 
			com.google.appengine.api.datastore.Key parent, Long fileEntityId) {
		if (staff == null || staff.length() < 11) {
			throw new IllegalArgumentException("Staff length > 10");
		}
		if (addressees == null || addressees.length() < 16) {
			throw new IllegalArgumentException("Addressees length > 15");			
		}
		if (progress == null || progress.length() < 11) {
			throw new IllegalArgumentException("Progress length > 10");
		}
		if (parent == null) {
			throw new IllegalArgumentException("Parent entity cannot be NULL");
		}
		fStaff = staff;
		fAddressees = addressees;
		fProgress = progress;
		fParent = parent;
		fFileEntityId = fileEntityId;
	}
	
	public final String getStaff() {
		return fStaff;
	}
	
	public final String getAddressees() {
		return fAddressees;
	}
	
	public final String getProgress() {
		return fProgress;
	}
	
	public final com.google.appengine.api.datastore.Key getParent() {
		return fParent;
	}
	
	public final Long getFileEntityId() {
		return fFileEntityId;
	}
	
}
